package com.bjsxt.homework6;

public class PrintABC {

    public static int state; // 用来标记当前应该由哪个线程打印

    public static final Object lock = new Object();

    public static void main(String[] args) {

        Thread threadA = new Thread(new Printer('a', 0, lock));
        Thread threadB = new Thread(new Printer('b', 1, lock));
        Thread threadC = new Thread(new Printer('c', 2, lock));

        threadA.start();
        threadB.start();
        threadC.start();
    }
}